home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 201-225 / disk_222 / plplot / examples / example06.c < prev    next >
C/C++ Source or Header  |  1992-05-06  |  1KB  |  54 lines

  1. /* Displays the plotter symbols for PLPOIN */
  2.  
  3. #include <stdio.h>
  4.  
  5. main()
  6. {
  7.       char text[3];
  8.       int i, j, k;
  9.       float x, y;
  10.  
  11. /* Full sized page for display */
  12.  
  13.       plstar(1,1);
  14.       pladv(0);
  15.  
  16. /* Set up viewport and window */
  17.  
  18.       plvpor(0.1,1.0,0.1,0.9);
  19.       plwind(0.0,1.0,0.0,1.3);
  20.  
  21. /* Draw the grid using plbox */
  22.  
  23.       plbox("bcgt",0.1,0,"bcgt",0.1,0);
  24.  
  25. /* Write the digits below the frame */
  26.  
  27.       for (i=0; i<=9; i++) {
  28.         sprintf(text,"%d",i);
  29.         plmtex("b",1.5,0.1*i+0.05,0.5,text);
  30.       }
  31.     
  32.       k=0;
  33.       for (i=0; i<=12; i++)  {
  34.  
  35. /* Write the digits to the left of the frame */
  36.  
  37.         sprintf(text,"%d",10*i);
  38.         plmtex("lv",1.0,1.0-(2*i+1)/26.0,1.0,text);
  39.         for (j=0; j<=9; j++) {
  40.           x=0.1*j+0.05;
  41.           y=1.25-0.1*i;
  42.  
  43. /* Display the symbols (plpoin expects that x and y are arrays so */
  44. /* pass pointers) */
  45.  
  46.           if (k < 128) plpoin(1,&x,&y,k);
  47.           k=k+1;
  48.         }
  49.       }
  50.  
  51.       plmtex("t",1.5,0.5,0.5,"PLPLOT Example 6 - PLPOIN symbols");
  52.       plend();
  53. }
  54.